package com.gobang.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 用户实体类
 * 对应数据库表：users
 * 
 * @author gobang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("users")
public class User {

    /**
     * 用户ID - 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名 - 唯一
     */
    @TableField("username")
    private String username;

    /**
     * 密码 - BCrypt加密
     */
    @TableField("password")
    private String password;

    /**
     * 当前积分
     */
    @TableField("current_score")
    private Integer currentScore;

    /**
     * 总场次
     */
    @TableField("total_games")
    private Integer totalGames;

    /**
     * 获胜场数
     */
    @TableField("win_games")
    private Integer winGames;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
} 